package cn.kgc.tangcco.controller;

import cn.kgc.tangcco.model.DB;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/test")
public class TestController {

    @Value("${person.nickname}")
    private String nickname;

    @Value("${person.age}")
    private Integer age;
    
    @GetMapping("/test01")
    public String test01() {
        return "桃李不言下自成蹊";
    }


    @GetMapping("/person")
    public Map<String, Object> person() {
        Map<String, Object> map = new HashMap<>();
        map.put("nickname", nickname);
        map.put("age", age);
        return map;
    }

}
